#!/usr/bin/perl
use XML::RSS;
use warnings;
use strict;
use CGI qw(:standard);

print header( -type => 'application/xml+rss' );

my $t = time();
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime ($t);
my $str = sprintf("%4d-%02d-%02d %02d:%02d:%02d\n", $year+1900, $mon+1, $mday, $hour, $min, $sec);
my $rss = new XML::RSS (version => '2.0');
$rss->channel(
    title          => 'Fecha y hora',
    link           => 'http://127.0.0.1/',
    language       => 'es',
    description    => 'La fecha y la hora',
);

$rss->add_item(
    title => "Fecha desde epoch",
    permaLink  => "http://127.0.0.1/",
    description => $t
);

$rss->add_item(
    title => "Fecha humanamente legible",
    permaLink  => "http://127.0.0.1/",
    description => $str
);

print $rss->as_string."\n";
